package com.cg.controller;

import com.cg.client.AppClient;
import com.cg.dto.Result;
import com.cg.vo.DoctorListVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName DoctorController
 * @Description doctor前端控制器
 * @Author CG
 * @Date 2024/1/8 18:12
 **/
@RestController
@RequestMapping("/doctor")
public class DoctorController {

    @Resource
    private AppClient appClient;

    /**
     * 根据医生姓名模糊查询医生列表
     */
    @GetMapping("/queryDoctorList")
    public Result<List<DoctorListVo>> queryDoctorList(String doctorName){
        return appClient.queryDoctorList(doctorName);
    }


    /**
     * 根据医生id查询医生详情
     */
    @GetMapping("/queryDoctorByDoctorId")
    public Result<DoctorListVo> queryDoctorByDoctorId(Integer doctorId){
        return appClient.queryDoctorByDoctorId(doctorId);
    }
}
